# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_prj=xray
_targets='artix7 kintex7 zynq7'
_commit=1a4ee7cb0d93eda01db7e2b2b6950407d58ed2fd
pkgname=prj$_prj-db
pkgver=r225.1a4ee7c
pkgrel=3
pkgdesc='Project X-Ray (Xilinx 7-series bit-stream format) database'
arch=('loong64' 'x86_64')
url="https://github.com/SymbiFlow/$pkgname"
license=('custom:CC0')
makedepends=('git')
source=("git+$url.git#commit=$_commit")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir"/usr/share/$_prj/database
  cp -r --no-preserve=ownership $_targets "$pkgdir"/usr/share/$_prj/database/

  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

